from simplefactory.cashnormal import CashNormal
from simplefactory.cashrebate import CashRebate
from simplefactory.cashreturn import CashReturn


# 工厂类
class CashFactory:
    def createCashAdapter(self, type):
        if type == "满100减20":
            return CashReturn(100, 20)
        elif type == "打八折":
            return CashRebate(0.8)
        else:
            return CashNormal()
